<template>
    <div class="flex h-screen overflow-hidden">
        <LeftPanel />
        <MapContainer />
    </div>
</template>

<script setup lang="ts">
import { onMounted } from 'vue'
import LeftPanel from './components/LeftPanel.vue'
import MapContainer from './components/MapContainer.vue'
import { useMapStore } from './store'
import { renderAddressMarkers } from './store/map'
import { loadFromStorage } from './store/storage'

const store = useMapStore()

onMounted(() => {
    // FocusAny插件初始化
    focusany.onPluginReady((data: any) => {
        console.log('onPluginReady', data)
        // 插件准备好后加载数据
        loadFromStorage()
        // 如果地图已经初始化，重新渲染标记
        if (store.map) {
            renderAddressMarkers()
        }
    })
})
</script>
